<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShipEquipmentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ship_equipment', function (Blueprint $table) {
            $table->increments('equipment_id');
            $table->string('equipment_name')->default('')->comment('设备名称');
            $table->string('model')->nullable()->comment('型号');
            $table->string('install_location')->nullable()->comment('安装位置');
            $table->integer('working_hours')->default('0')->nullable()->comment('工作小时数');
            $table->date('last_maintenance_date')->nullable()->comment('上次维护日期');
            $table->date('next_maintenance_date')->nullable()->comment('下次计划维护日期');
            $table->tinyInteger('status')->default('1')->nullable()->comment('状态(1:正常 2:维修中 3:报废)');
            $table->string('manufacturer')->nullable()->comment('制造商');
            $table->date('purchase_date')->nullable()->comment('购买日期');
            $table->string('ship_id')->default('')->comment('所属船舶编号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ship_equipment');
    }
}
